import sphRequest from "@/utils/sphRequest";
import wyRequest from "@/utils/wyRequest";
import { CategoryListModel } from "./module/categoryType";

// 左侧导航
export const reqGetCategoryList = () => {
  return wyRequest.get<any, any>('/item/cateList.json?__timestamp=1630131286110')
}

// 右侧列表
export const GetCategoryInfoData = (id: any) => {
  return wyRequest.get<any, any>(`/item/cateList.json?__timestamp=1630131455012&categoryId=${id}`)
}

// 列表详情
export const GetCategoryListDetails = (id1: any, id2: any) => {
  return wyRequest.get<any, any>(`/item/list.json?__timestamp=1630133942864&categoryType=0&subCategoryId=${id2}&categoryId=${id1}`)
}

// 商品详情
export const getListData = (id: number) => {
  return sphRequest.get(`/api/item/${id}`)
}

export const AddDataInfo = (skuId: number, skuNum: number) => {
  return sphRequest.post(`/api/cart/addToCart/${skuId}/${skuNum}`)
}